From: Claudio Cambra Date: Thu, 8 May 2025 05:49:29 +0000 (+0800) Subject: fix(macOS): Send user agent string over File Provider socket along with account details X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1^2~13^2^2^2~4 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22Programmet/%22http:/www.example.com/cgi/%22https:/%22Programmet?a=commitdiff_plain;h=6d0750be8ed9c0991594852f18d554d29b8645ef;p=nextcloud-desktop.git fix(macOS): Send user agent string over File Provider socket along with account details Signed-off-by: Claudio Cambra --- diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderSocketLineProcessor.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderSocketLineProcessor.swift index c9a49d419..1fd7d2d48 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderSocketLineProcessor.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderSocketLineProcessor.swift @@ -46,14 +46,21 @@ class FileProviderSocketLineProcessor: NSObject, LineProcessor { delegate.removeAccountConfig() } else if command == "ACCOUNT_DETAILS" { guard let accountDetailsSubsequence = splitLine.last else { return } - let splitAccountDetails = accountDetailsSubsequence.split(separator: "~", maxSplits: 3) + let splitAccountDetails = accountDetailsSubsequence.split(separator: "~", maxSplits: 4) - let user = String(splitAccountDetails[0]) - let userId = String(splitAccountDetails[1]) - let serverUrl = String(splitAccountDetails[2]) - let password = String(splitAccountDetails[3]) + let userAgent = String(splitAccountDetails[0]) + let user = String(splitAccountDetails[1]) + let userId = String(splitAccountDetails[2]) + let serverUrl = String(splitAccountDetails[3]) + let password = String(splitAccountDetails[4]) - delegate.setupDomainAccount(user: user, userId: userId, serverUrl: serverUrl, password: password) + delegate.setupDomainAccount( + user: user, + userId: userId, + serverUrl: serverUrl, + password: password, + userAgent: userAgent + ) } } } diff --git a/src/gui/macOS/fileprovidersocketcontroller.cpp b/src/gui/macOS/fileprovidersocketcontroller.cpp index afe69acbf..03eb2d10e 100644 --- a/src/gui/macOS/fileprovidersocketcontroller.cpp +++ b/src/gui/macOS/fileprovidersocketcontroller.cpp @@ -18,6 +18,7 @@ #include #include "accountmanager.h" +#include "common/utility.h" #include "fileproviderdomainmanager.h" namespace OCC { @@ -237,6 +238,7 @@ void FileProviderSocketController::sendAccountDetails() const // We cannot use colons as separators here due to "https://" in the url const auto message = QString(QStringLiteral("ACCOUNT_DETAILS:") + + Utility::userAgentString() + "~" + accountUser + "~" + accountUserId + "~" + accountUrl + "~" +